package com.qf.exception;

public class User {

    private String name;

    private Integer age;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        if (age<=0||age>180){
//            age = 18;
//            throw new RuntimeException("年龄非法");
            throw new AgeException(-1003,"年龄非法");
        }

        this.age = age;
    }
}
